package com.ysynzehao.controller;

import com.ysynzehao.bean.User;
import com.ysynzehao.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * niuzehao
 * 2018/11/30 10:55.
 */
@RestController
@RequestMapping(value="/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("getUser")
    public ResponseEntity<String> getUser() {
        return ResponseEntity.ok(userService.getUserName());
    }
}
